<?php

namespace app\merchant\controller\merchant;
use app\common\controller\BaseController;
use app\common\service\merchant\MerchantService;
use app\common\validate\merchant\MerchantValidate;
use hg\apidoc\annotation as Apidoc;
/**
 * @Apidoc\Title("商户管理")
 * @Apidoc\Group("merchant")
 * @Apidoc\Sort("250")
 */
class Merchant extends BaseController
{
    /**
    * @Apidoc\Title("资金明细")
    * @Apidoc\Query(ref="pagingQuery")
    * @Apidoc\Query(ref="sortQuery")
    * @Apidoc\Query(ref="searchQuery")
    * @Apidoc\Query(ref="dateQuery")
    * @Apidoc\Returned(ref="expsReturn")
    * @Apidoc\Returned(ref="pagingReturn")
    * @Apidoc\Returned("list", type="array", desc="商户管理列表", children={
    *   @Apidoc\Returned(ref="app\common\model\Merchant\MerchantBillModel", field="id,create_time,update_time")
    * })
    */
    public function bill()
    {
        $where = $this->buildWhere([
            'type'
        ]);
        $where = $this->where(where_delete($where));
        $where[] = ['mer_id','=',mer_id()];
        $data = MerchantService::bill($where, $this->page(), $this->limit(), $this->order());
        return success($data);
    }
    /**
     * @Apidoc\Title("充值明细")
     * @Apidoc\Query(ref="pagingQuery")
     * @Apidoc\Query(ref="sortQuery")
     * @Apidoc\Query(ref="searchQuery")
     * @Apidoc\Query(ref="dateQuery")
     * @Apidoc\Returned(ref="expsReturn")
     * @Apidoc\Returned(ref="pagingReturn")
     * @Apidoc\Returned("list", type="array", desc="商户管理列表", children={
     *   @Apidoc\Returned(ref="app\common\model\Merchant\MerchantBillModel", field="id,create_time,update_time")
     * })
     */
    public function recharge_bill()
    {

    }
    /**
     * @Apidoc\Title("账单类型")
     * @Apidoc\Query(ref="sortQuery")
     * @Apidoc\Query(ref="searchQuery")
     * @Apidoc\Query(ref="dateQuery")
     * @Apidoc\Returned(ref="app\common\model\Merchant\MerchantBillModel", field="id,title")
     */
    public function selectBillType()
    {
        $data = MerchantService::getBillType();
        return success($data);
    }
    /**
     * @Apidoc\Title("自选买号")
     * @Apidoc\Query(ref="sortQuery")
     * @Apidoc\Query(ref="searchQuery")
     * @Apidoc\Query(ref="dateQuery")
     * @Apidoc\Returned(ref="app\common\model\Merchant\MerchantBillModel", field="id,title")
     */
    public function selectAccount()
    {

    }
}
